class FyStorage {
    Storage

    constructor(type) {
        this.Storage = localStorage
    }

    set(key, value) {
        this.Storage.setItem(key, JSON.stringify(value))
    }

    get(key) {
        const value = this.Storage.getItem(key)
        if (value) {
            return JSON.parse(value)
        }
    }

    remove(key) {
        this.Storage.removeItem(key)
    }

    clear() {
        this.Storage.clear()
    }
}

const Storage = new FyStorage()

export default Storage